import java.util.Scanner;
public class calcul
{
	public static double caculator (double a,double b,String op) {
	    Scanner input =new Scanner(System.in);
           // double a,b;
	   double c;
	   // String op = null;
	   String choice = null;
	   // do{
		System.out.println ("Input a and b:");
                a = input.nextDouble();
                b = input.nextDouble();
		System.out.println("input op:");
		op = input.next();
		switch (op)
		{
			case "+":
				c = a + b;
				break;
			case "-":
				c = a - b;
				break;
			case "*":
				c = a * b;
				break;
			case "/":
				if(b==0)
				{
					System.out.println("b can't be 0!");
					c = 0;
				}
				else{ c = a / b;}
				break;
			case "%":
				c = a % b;
				break;
			default:
				System.out.println("error!");
				c = 0;
				break;
		}
		//System.out.println(a+op+b+"="+c);
		return c;

}
	}
